import { Schema as _Schema, model } from "mongoose";
const Schema = _Schema;

const UserSchema = new Schema({
    username: {
        type: String,
        required: true,
        trim: true,
    },
    email: {
        type: String,
        required: true,
        trim: true,
    },
    password: {
        type: String,
        required: true,
    },
    role: {
        type: String,
        default: "student",
        enum: ["student", "ta", "teacher", "admin"],
    },
    accessToken: {
        type: String,
    },
});

const User = model("user", UserSchema);

export default User;
